package com.zhongyu.boot02.controller;

import com.zhongyu.boot02.pojo.user;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class UserController {
    @GetMapping("/user/list")
    public String list(Model model){
        List<user> list=new ArrayList<>();
        list.add(new user(1001,"张三",19,"河北邯郸"));
        list.add(new user(1001,"李四",20,"河北衡水"));
        list.add(new user(1001,"王五",17,"河北石家庄"));
        list.add(new user(1001,"赵柳",12,"河北承德"));
        model.addAttribute("list",list);
        return "userList";
    }
}
